package com.szrt.java.day20170113.demo06;

public class FlyCar {

	/**
	 * 装饰者模式
	 * 组合：在一个类有另外一个类 解决单继承问题
	 */
	
	private SwimCar car;

	public FlyCar() {
		
	}
	public FlyCar(SwimCar car) {
		this.car = car;
	}
	public SwimCar getCar() {
		return car;
	}
	public void setCar(SwimCar car) {
		this.car = car;
	}
	
	public void drive(){
		car.drive();
		fly();
	}
	
	public void fly(){
		System.out.println("在天上飞...");
	}
	
	
	
}
